package com.acegear.horizon.domain.repository.jpa;

import com.acegear.horizon.domain.models.jpa.WechatAuth;

import org.springframework.data.repository.CrudRepository;

import java.util.Optional;

/**
 * Created by mercury on 2016/12/12.
 */
public interface WechatAuthRepository extends CrudRepository<WechatAuth, Long> {
    Optional<WechatAuth> findByUserIdAndType(Long userId, Integer type);

    Optional<WechatAuth> findByUnionIdAndType(String unionId, Integer type);

    Optional<WechatAuth> findTopByUnionId(String unionId);

    Optional<WechatAuth> findByOpenId(String openId);
}
